import java.awt.event.*;
import java.awt.*;
/**
 * La clase HandwheelMode establece componentes para
 * permitir el control manual del movimiento de la herramienta 
 * mediante la manivela.
 */
public class HandwheelMode extends Mode
{
    public HandwheelMode()
    {
        super(
            "handwheelMode",
            KbdCmdId.CmdValue.MODE_HANDWHEEL
        );
    }
    public void setDescriptionViewPanel()
    {
        addTopPanels(
            "emergencyStop",
            Mode.Place.NORTH,
            new GridBagConstraints(
                1,
                0,
                1,
                1,
                0,
                0,
                GridBagConstraints.EAST,
                GridBagConstraints.NONE,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.EMERGENCY_STOP
            },
            null
        );
        addTopPanels(
            "operationMode",
            Mode.Place.NORTH,
            new GridBagConstraints(
                0,
                0,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.OPERATION_MODE
            },
            null
        );
        addTopPanels(
            "targetPosition",
            Mode.Place.CENTER,
            new GridBagConstraints(
                0,
                2,
                1,
                2,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.ATP
            },
            null
        );
        addTopPanels(
            "state",
            Mode.Place.CENTER,
            new GridBagConstraints(
                2,
                0,
                1,
                3,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.AXIS_LIMIT_SWITCH
            },
            null
        );
        addTopPanels(
            "currentPosition",
            Mode.Place.CENTER,
            new GridBagConstraints(
                0,
                0,
                1,
                2,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.AXIS_CURRENT_POSITION
            },
            null
        );
        addTopPanels(
            "motionTravelRange",
            Mode.Place.CENTER,
            new GridBagConstraints(
                1,
                0,
                1,
                2,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.AXIS_MOTION_TRAVEL_RANGE
            },
            null
        );
        addTopPanels(
            "spindle",
            Mode.Place.CENTER,
            new GridBagConstraints(
                2,
                3,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.SPINDLE
            },
            null
        );
        addTopPanels(
            "devices",
            Mode.Place.CENTER,
            new GridBagConstraints(
                1,
                2,
                1,
                2,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.DEVICES
            },
            null
        );
    }
    public void setDescriptionEditablePanel()
    {
        addBottomPanels(
            "pathPlanning",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.WORK_OFFSET,
                Data.Id.TOOL_OFFSET
            },
            null,
            new GridLayout(1,2)
        );
        addBottomPanels(
            "axisMotion",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.HANDWHEEL_FACTOR,
                Data.Id.HANDWHEEL_AXIS,
                Data.Id.OTHER,
                Data.Id.OTHER
            },
            new AnotherComponent[] {
                AnotherComponent.PANEL,
                AnotherComponent.PANEL
            },
            new GridLayout(2,2)
        );
        addBottomPanels(
            "spindle",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.SPINDLE_DIRECTION,
                Data.Id.SPINDLE_SPEED_OVERRIDE,
                Data.Id.SPINDLE_SPEED,
                Data.Id.OTHER,
                Data.Id.OTHER,
                Data.Id.OTHER
            },
            new AnotherComponent[] {
                AnotherComponent.PANEL,
                AnotherComponent.PANEL,
                AnotherComponent.PANEL
            },
            new GridLayout(2,3)
        );
        addBottomPanels(
            "devices",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.DEVICES,
                Data.Id.OTHER
            },
            new AnotherComponent[] {
                AnotherComponent.PANEL
            },
            new GridLayout(2,1)
        );
        addBottomPanels(
            "changeDialog",
            Mode.Place.EAST,
            new Data.Id[] {
                Data.Id.OTHER
            },
            new AnotherComponent[] {
                AnotherComponent.VALIDATE_CHANGE
            },
            new GridLayout(1,1)
        );
    }
}
